<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<script>
	function goInsert() {
		var form = document.getElementById("form");
		form.action = '/member/insert.html';
		form.submit();
	}
	function goUpdate() {
		var form = document.getElementById("form");
		form.action = '/member/update.html';
		form.submit();
	}
</script>
<form id="form" name="form" method="post" enctype="multipart/form-data">
<c:if test="${not empty member}">
<input type="hidden" name="id" value="${member.id}"/>
</c:if>
<table>
	<tr>
		<th>핸드폰번호</th>
		<td><input type="text" name="phoneNo" value="${member.phoneNo}"/></td>
	</tr>
	<tr>
		<th>비밀번호</th>
		<td><input type="text" name="pw" value="${member.pw}" /></td>
	</tr>
	<tr>
		<th>비밀번호 확인</th>
		<td><input type="text" name="pwConfirm" value="" /></td>
	</tr>
	<tr>
		<th>닉네임</th>
		<td><input type="text" name="nickname" value="${member.nickname}" /></td>
	</tr>
</table>
<div>
	<p>
		<c:if test="${empty member}"><input type="button" value="저장" onclick="goInsert()"/></c:if>
		<c:if test="${not empty member}"><input type="button" value="수정" onclick="goUpdate()"/></c:if>
	</p>
</div>
</form>
